package cn.iocoder.yudao.module.ride.dal.mysql.ruledict;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ride.dal.dataobject.ruledict.RuleDictDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ride.controller.admin.ruledict.vo.*;

/**
 * 规则字典 Mapper
 *
 * @author tong
 */
@Mapper
public interface RuleDictMapper extends BaseMapperX<RuleDictDO> {

    default PageResult<RuleDictDO> selectPage(RuleDictPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RuleDictDO>()
                .eqIfPresent(RuleDictDO::getRuleType, reqVO.getRuleType())
                .eqIfPresent(RuleDictDO::getRuleCode, reqVO.getRuleCode())
                .likeIfPresent(RuleDictDO::getRuleName, reqVO.getRuleName())
                .orderByDesc(RuleDictDO::getId));
    }

}